/**
 * 作者: chenlingzhi
 * 日期: 2024-12-17 20:24:42
 * 备注: 充值记录表（直接入库）
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.protocol.Common;

public class IapRecord extends IapRecordModel {
    public IapRecord() {
        super();
    }

    public IapRecord(long userId, String userName, int serverId, int platform, long channel, int iapGiftId, int diamond,
                     String productId, String orderId, double money, String transInfo, boolean isMissOrder,
                     boolean isFake, long time, int level, int iapId, int actRechargeType) {
        super();
        putUserId(userId);
        putUserName(userName);
        putServerId(serverId);
        putPlatform(platform);
        putChannel(channel);
        putIapGiftId(iapGiftId);
        putDiamond(diamond);
        putProductId(productId);
        putOrderId(orderId);
        putMoney(money);
        putTransInfo(transInfo);
        putIsMiss((byte) (isMissOrder ? 1 : 0));
        putIsFake((byte) (isFake ? 1 : 0));
        putAddTime(time);
        putLevel(level);
        putIapId(iapId);
        putActRechargeType(actRechargeType);
    }

    public Common.PBIapRecord.Builder takeBuilder() {
        Common.PBIapRecord.Builder sb = Common.PBIapRecord.newBuilder();
        sb.setId(id); // id
        sb.setIapId(iapId); // 充值项id
        sb.setIapGiftId(iapGiftId); // 充值礼包id
        sb.setAddTime(addTime); // 订单时间

        return sb;
    }
}
